﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Management;
using System.Text;
using System.Windows.Forms;
using Common;

namespace Contrast
{
    public partial class PassWord : Form
    {
        public PassWord()
        {
            InitializeComponent();
        }

        private void PassWord_Load(object sender, EventArgs e)
        {
            this.textBox2.Text = ComputerInfo.GetHDDSerial();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string dsds = "YS202010458920AA"; //ComputerInfo.GetHDDSerial().Trim();
            dsds = ComputerInfo.GetEncryptPassword(dsds);
           
            if (textBox1.Text == dsds)
            {
                MessageBox.Show("授权成功");
                XML.write("pass", dsds, "p.xml");
                DialogResult = DialogResult.OK;
            }
            else
            {
                MessageBox.Show("授权码不正确");
            }
        }
    }
}
